package com.cb.wlm.controller;

import com.cb.service.CoordinateService;
import com.jia.vo.Result;
import com.jia.vo.ResultCodeEnum;
import com.jia.vo.admin.SitesVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class MapController {

    @Autowired
    private CoordinateService coordinateService;

    @GetMapping("/mapList")
    @Operation(description = "获取所有站点信息")
    public Result<SitesVo> mapList() {
        return Result.build(coordinateService.mapList(), ResultCodeEnum.SUCCESS);
    }
    @GetMapping("/mapInfo")
    @Operation(description = "获取所有站点信息")
    public Result mapList2(String x, String y) {
        System.out.println(x+" "+y);
        return  Result.build(coordinateService.mapinfo(x,y), ResultCodeEnum.SUCCESS);
    }
}
